<%@taglib uri="/WEB-INF/tlds/libreria.tld" prefix="lb"%>
<%@taglib uri="http://displaytag.sf.net" prefix="dt"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<SCRIPT language="JavaScript" src="<%= request.getContextPath() %>/javascript/funcionesgenerales.js"></script>
<SCRIPT language="JavaScript" src="<%= request.getContextPath() %>/javascript/ValidacionesGenerales.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Registro de unidades</title>
<script type="text/JavaScript">
<!--
function f_insertar(){
    mostrar("capa1");
    ocultar("trCodigo");
   	document.frm_Manto.txh_Accion.value='Grabar';
    document.frm_Manto.txt_Nombre.focus();
  }

 function f_actualizar(Codigo,Nombre){
//    alert(Codigo +" con Codigo !!!");
    mostrar("trCodigo");
    document.frm_Manto.txt_Codigo.value=Codigo;
    document.frm_Manto.txt_Nombre.value=Nombre;
    document.frm_Manto.txh_Accion.value="Actualizar";
	
    mostrar("capa1");
  }

function f_cancelar(){
    document.frm_Manto.txt_Codigo.value="";
    document.frm_Manto.txt_Nombre.value="";
	document.frm_Manto.txh_Accion.value="";
    ocultar("capa1");
    ocultar("trCodigo");
  }
  
  function ValidaForm(){

   
	if (confirm("Esta seguro de grabar")) {
		if (document.frm_Manto.txt_Nombre.value==" "){
   			alert("Ingrese Nombre!!");document.frm_Manto.txt_Nombre.focus();}
  		else{
			//document.frm_Manto.txh_Accion.value='Grabar';
			document.frm_Manto.action="<%= request.getContextPath() %>/srvempleo";
			document.frm_Manto.submit();
		
		}
	}else{alert("Operacion Cancelada");}	
	}

function mostrar(nombreCapa){
    document.getElementById(nombreCapa).style.visibility="visible";
  }
  
  function ocultar(nombreCapa){
    document.getElementById(nombreCapa).style.visibility="hidden";
  }
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

//-->

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<link href="../../css/estilo_cine.css" rel="stylesheet" type="text/css" media="all" />
<style type="text/css" media="all">
     
      @import url("css/screen.css");
</style>

<body onload="MM_preloadImages('<%= request.getContextPath() %>/imagenes/botones/btn_agregarb.gif','<%= request.getContextPath() %>/imagenes/botones/btn_salirb.gif','<%= request.getContextPath() %>/imagenes/botones/btn_grabarb.gif','<%= request.getContextPath() %>/imagenes/botones/btn_agregarb.gif','<%= request.getContextPath() %>/imagenes/botones/btn_salirb.gif','<%= request.getContextPath() %>/imagenes/botones/cancelars.gif')" background="<%= request.getContextPath() %>/imagenes/fondos/fondo.jpg" >
<form name="frm_Manto" method="post" action="">
  <input type="hidden" name="txh_Accion" >
<table width="650"border="4" align="center" cellpadding="0" cellspacing="0" bordercolor="#333333" style="width:650px">
  <tr>
    <td><table width="650" border="0" align="center" cellpadding="0" cellspacing="0" style="width:650px">
  <tr>
    <td height="136" background="<%= request.getContextPath() %>/imagenes/titulos/cabecera.jpg" style="background-repeat:no-repeat;background-position:center">&nbsp;</td>
  </tr>
  <tr>
    <td><div align="center"><img src="<%= request.getContextPath() %>/imagenes/titulos/tituo_registroUnidad.gif"  width="380" height="40"/></div></td>
  </tr>
  <tr>
    <td><table width="600" border="0" cellspacing="0" cellpadding="0" style="width:600px">
      <tr>
        <td width="694" rowspan="2"><dt:table  name="listaemp" requestURI="listaempleo" pagesize="10" id="usu"  class="isis" style="width:500px"> 
              <dt:column property="COD_EMPLEO"  title="CODIGO" sortable="true"   ></dt:column>
              <dt:column property="NOM_EMPLEO"  title="NOMBRE" sortable="true" >  </dt:column>
              <dt:column title="ACTUALIZAR">
   <div align="center"><a href="javascript:f_actualizar('<c:out value="${usu.COD_EMPLEO}"/>','<c:out value="${usu.NOM_EMPLEO}"/>');">Actualizar </a></div>
              </dt:column>
          </dt:table></td>
      </tr>
      <tr>
        <td><a href="javascript:f_insertar()" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','<%= request.getContextPath() %>/imagenes/botones/btn_agregarb.gif',1)"><img src="<%= request.getContextPath() %>/imagenes/botones/btn_agregara.gif" name="Image1" width="100" height="30" border="0" id="Image1" /></a><br />
          <a href="<%= request.getContextPath() %>/cineplanet/administracion/login/frm_cineplanet_menu_principal.jsp" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image2','','<%= request.getContextPath() %>/imagenes/botones/btn_salirb.gif',1)"><img src="<%= request.getContextPath() %>/imagenes/botones/btn_salira.gif" name="Image2" width="100" height="30" border="0" id="Image2" /></a></td>
      </tr>
      <tr>
        <td colspan="2"><div id="capa1" align="center" style="visibility:hidden"><table border="1" bgcolor="F9F9F2" style="background-position:center;width:524px" cellpadding="0" cellspacing="0" background="<%= request.getContextPath() %>/imagenes/fondos/PaginaManto.jpg">
                <tr>
                  <td height="136">
                  <table width="524" border="0" align="center" style="width:524px">
                    <tr id="trCodigo">
                      <td width="214"><div align="right"><span class="nombre_campo">C&oacute;digo : </span></div></td>
                      <td width="300" ><div align="left">
                        <input name="txt_Codigo" type="text" size="3" maxlength="3" readonly="true"> <!-- readonly="TRUE"-->  
                      </div></td>
                    </tr>
                    <tr>
                      <td><div align="right"><span class="nombre_campo">Nombre : </span></div></td>
                      <td><div align="left">
                        <input name="txt_Nombre" type="text"  onKeyUp="frm_Manto.txt_Nombre.value=frm_Manto.txt_Nombre.value.toUpperCase();"  size="30" maxlength="30">
                      </div></td>
                    </tr>
					<tr>
                      <td colspan="2"><div align="center"><a href="javascript:ValidaForm();" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image3','','<%= request.getContextPath() %>/imagenes/botones/btn_grabarb.gif',1)"><img src="<%= request.getContextPath() %>/imagenes/botones/btn_grabara.gif" name="Image3" width="100" height="30" border="0" id="Image3" /></a><a href="javascript:f_cancelar();" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image4','','<%= request.getContextPath() %>/imagenes/botones/cancelars.gif',1)"><img src="<%= request.getContextPath() %>/imagenes/botones/cancelara.gif" name="Image4" width="100" height="30" border="0" id="Image4" /></a></div></td>
                      </tr>
                  </table>
                  <br />
                  <p>&nbsp;</p></td>
                </tr>
            </table></div></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
</table></td>
  </tr>
</table>


</form>
</body>
</html>
